feat(cli): Add feature flags for modular CLI builds#93
Merged
Conversation
Implement Cargo feature flags to make the CLI binary modular: - default = [] (minimal: TUI + exec + ACP only) - full = all features for complete functionality - Individual features: app-server, cloud-tasks, login, mcp-server, chatgpt, responses-api-proxy This reduces release binary size from 46MB to 36MB (22% reduction) for minimal builds by excluding optional HTTP-based functionality. Key changes: - Made 6 dependencies optional with dep: prefix - Added #[cfg(feature = "...")] guards to main.rs imports, enum variants, and match arms - Added required-features to MCP integration tests - Updated docs.md with feature flag documentation 🤖 Generated with [Nori](https://nori.ai) Co-Authored-By: Nori <contact@tilework.tech>
Collaborator
Author
Feature Flags Implementation CompleteThis update completes the feature flags implementation as specified in FEATURE_PLAN.md. New AdditionsNori Update System (
CLI Feature Propagation (
Slash Command Visibility:
Build Modes
Test ResultsAll tests pass:
🤖 Generated with Nori |
Add conditional compilation throughout TUI crate to enable modular builds: - Define feature flags in Cargo.toml: full, login, feedback, backend-client, upstream-updates - Make codex-login, codex-feedback, codex-backend-client optional dependencies - Gate onboarding auth flow with #[cfg(feature = "login")] - Gate feedback popups and events with #[cfg(feature = "feedback")] - Gate BackendClient usage with #[cfg(feature = "backend-client")] - Hide /logout and /feedback slash commands when features disabled - Add nori/feedback.rs to redirect feedback to GitHub Discussions - Add nori/update_action.rs and nori/updates.rs for Nori update system - Gate feedback-related tests with #[cfg(feature = "feedback")] - Create FEATURE_PLAN.md documenting the implementation plan This enables the Nori CLI fork to default to ACP-only mode without OpenAI-specific functionality, while allowing full-featured builds via --features full.
- Add Nori-specific update modules (update_action.rs, updates.rs, update_prompt.rs) - Gate slash command visibility based on features (login, feedback) - Add CLI feature propagation to TUI crate - Update documentation for feature flags architecture - Remove unnecessary dead code workaround in updates.rs - Add documentation for get_update_action() design decision 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d7b6dfd to
0fddda2
Compare
Add missing re-export of nori::updates as crate::updates when upstream-updates feature is disabled. This fixes a release build error where app.rs calls crate::updates::get_upgrade_version() but the module wasn't available in the Nori configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add `oss-providers` feature flag to gate codex-ollama and codex-lmstudio - CLI, TUI, and common crates now support `oss-providers` feature - OSS provider functions return stubs when feature disabled - Improve feedback_compat.rs stub for API compatibility - Match anyhow::Result<()> return type for upload_feedback - Add proper tests with feature-gated assertions - Add placeholder comments for future Nori feedback integration - Include `oss-providers` in `full` feature bundle - Update documentation in docs.md files This continues the feature flags work to enable minimal binary builds by making OSS provider dependencies optional. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
Author
Update: Gate OSS providers and improve feedback stubThis commit adds the following improvements: OSS Providers Feature Flag
Feedback Stub Improvements
Files Changed
Testing
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
🤖 Generated with Nori
default = [](minimal) andfull(complete) configurationscodex-app-server,codex-chatgpt,codex-cloud-tasks,codex-login,codex-mcp-server,codex-responses-api-proxy,codex-rmcp-client#[cfg(feature = "...")]guards throughoutmain.rsfor conditional compilationTest Plan
cargo build -p codex-cli(minimal) compiles successfullycargo build -p codex-cli --features fullcompiles successfullycargo test --all --features fullpassescargo clippy --all --features fullpassesmcp-serverfeatureShare Nori with your team: https://www.npmjs.com/package/nori-ai